package com.lmf.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.lang.reflect.Field;

@RestController
public class TestController {
    /**
     * 获取class对象
     */
    @GetMapping("/getObject")
    public String getObject(){
        try {
            Class clasz=Class.forName("com.lmf.entity.User");
            Field[] fields=clasz.getFields();
            for(Field f:fields){
                System.out.println(f);
            }
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
        return "ok";
    }
}
